<?php

class Application_Form_Sendmsg extends Zend_Form {

    public function init() {
        $this->setMethod("post");
        // ->setAction("/send/message");

        $name = new Zend_Form_Element_Text('name');
        $name->setLabel("Enter your name:")
                ->setRequired()
                ->addFilter("StringTrim")
                ->setAttribs(array('placeholder' => 'Enter your name', 'class' => 'span6', 'required' => 'required'));

        $email = new Zend_Form_Element_Text('email');
        $email->setLabel("Enter your email address:")
                ->addValidator("EmailAddress")
                ->addFilter("StringTrim")
                ->addFilter('StringToLower')
                ->setAttribs(array('placeholder' => 'Enter your email', 'class' => 'span6'))
                ->addErrorMessages(array("Invalid email address"));

        $mobile = new Zend_Form_Element_Text('mobile');
        $mobile->setLabel("Enter your mobile number:")
                ->addFilter("StringTrim")
                ->addValidator('regex', false, array('/^[0-9 ]+$/'))
                ->setAttribs(array('placeholder' => 'Enter your mobile number', 'class' => 'span6'))
                ->addErrorMessages(array("Invalid mobile number"));

        $storeId = new Zend_Form_Element_Hidden('storeId');
        $storeId->setValue(0);

        $submit = new Zend_Form_Element_Submit('submit');
        $submit->setLabel("Get Details")
                ->setAttribs(array('class' => 'btn btn-info'));


        $this->addElements(array($name, $email, $mobile, $storeId, $submit));
    }

}

